home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / dsp4tool / dl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-11  |  1.3 KB  |  40 lines

  1. /*  DL.C -- Download DSP56001 programs to the DSP CARD 4
  2.  *
  3.  *  Copyright (C) by Alef Null 1990, 1991, 1992
  4.  *  Author(s): Jarkko Vuori, OH2LNS
  5.  *  Modification(s):
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <sys\types.h>
  12. #include <sys\stat.h>
  13. #include "utils.h"
  14. #include "dl.h"
  15.  
  16.  
  17. CMDS args[] = {
  18.     { 'F', False,False, "-f         <rom_image>  - program FLASH EPROM", { ReadOnly, Last }, { ".BIN" }, NULL },
  19.     { 'C', True, False, "-c<numarg>              - change program",     { Last },         { "" },     NULL },
  20.     { 'R', False,False, "-r         <rom_image>  - read FLASH EPROM",     { Modify, Last },   { ".BIN" }, NULL },
  21.     { 'G', False,False, "-g         <load_image> - load RAM and go",     { ReadOnly, Last }, { ".LOD" }, loadandgo },
  22.     { 'P', True, False, "-p<numarg>              - set current port",     { Last },         { "" },     setport },
  23. };
  24.  
  25.  
  26. static void usage(void) {
  27.     CMDS *p;
  28.  
  29.     fprintf(stderr, "usage: dl -<command>[numarg] [<rom_image>|<load_image>]\n");
  30.     for (p = args; p < &args[sizeof(args)/sizeof(CMDS)]; p++)
  31.     fprintf(stderr, "    %s\n", p->usage);
  32. }
  33.  
  34.  
  35. int cdecl main(int argc, char *argv[]) {
  36.     printf("DSP CARD 4 program downloader (%s)\n", __DATE__);
  37.  
  38.     return (ParseCommands(argc, argv, args, sizeof(args)/sizeof(CMDS), 0, usage));
  39. }
  40.